﻿<Window x:Class="DocumentManagement.Views.CreateDocumentOUT"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:DocumentManagement.ViewsModels"
        Title="CreateDocumentOUT" Height="1500" Width="825" Loaded="Window_Loaded" xmlns:my="clr-namespace:DocumentManagement.Converters" WindowStartupLocation="Manual" ResizeMode="NoResize">
    <Window.Resources>
        <vm:CreateDocumentOUTViewsModel x:Key="createDocumentOUTViewsModel"/>
        <ContextMenu x:Key="MyContextMenu">
            <MenuItem Header="ลบไฟล์สิ่งที่ส่งมาด้วย" Name="deleteCreateDocMenu" Click="deleteCreateDocMenu_Click" />
        </ContextMenu>
        <my:DateConverter x:Key="dateConverter" />
    </Window.Resources>
    
    <Grid Margin="10,10,-10,-10" Name="grid1" Width="792">
       
        <ScrollViewer VerticalScrollBarVisibility="Visible" Margin="0,32,0,0">
                <Grid Margin="0,38,0,0" Name="grid2" DataContext="{Binding Source={StaticResource createDocumentOUTViewsModel}}"  Width="777" Height="1453">
                
                    <StackPanel Name="stackPanel1">
                        <StackPanel Name="stackPanel3" Orientation="Vertical">
                            <Image Height="112" Name="image1" Source="/DocumentManagement;component/Images/pic.jpg" Stretch="Fill" Width="117" />
                        </StackPanel>
                        <StackPanel Margin="0,-50,0,0" Name="stackPanel4" Orientation="Horizontal">
                            <TextBlock FontFamily="TH SarabunPSK" FontSize="26" FontWeight="Bold" Foreground="#FFFC0D0D" Margin="160,0,0,0" TextAlignment="Center" />
                        </StackPanel>
                        <StackPanel Margin="0,-25,0,0" Name="stackPanel999" Orientation="Horizontal">
                            <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="ที่  " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="193" Text="{Binding Path=MyCreateSend.CreateSendCode, Mode=TwoWay}" Name="CreateSendCodeTextBox" IsEnabled="True" TabIndex="1" />
                        <TextBlock  FontFamily="TH SarabunPSK" FontSize="20" Margin="100,0,0,0" Text="ส่วนราชการ" Width="67" Name="NameInstitutionTextBlock" />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="258" Text="{Binding Path=MyCreateSend.NameInstitution, Mode=TwoWay}" Name="NameInstitutionTextBox" TabIndex="2"  />
                        </StackPanel>
                        <StackPanel Name="stackPanel5" Orientation="Horizontal">
                           
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="430,0,0,0" Text="ที่อยู่" Width="67" Name="AddressTextBlock" />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="258" Text="{Binding Path=MyCreateSend.Address, Mode=TwoWay}" Name="AddressTextBox" TabIndex="3" IsTabStop="True" />
                    </StackPanel>
                    <StackPanel Name="stackPanel55" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Name="rowAddress11" Text="ชั้นความเร็ว  " />
                        <GroupBox Height="31" Name="groupBox3" Width="299">
                            <Grid Height="26">
                                <RadioButton Content="ปกติ" FontFamily="TH SarabunPSK" FontSize="20" Height="22" HorizontalAlignment="Left" IsEnabled="True" IsTabStop="False" Margin="6,2,0,0" Name="SpeedRadio1" VerticalAlignment="Top" IsChecked="{Binding Path=MySpeed1, Mode=TwoWay}" />
                                <RadioButton Content="ด่วน" FontFamily="TH SarabunPSK" FontSize="20" Height="22" HorizontalAlignment="Left" Margin="59,2,0,0" Name="SpeedRadio2" VerticalAlignment="Top" IsChecked="{Binding Path=MySpeed2, Mode=TwoWay}" IsTabStop="False" />
                                <RadioButton Content="ด่วนมาก" FontFamily="TH SarabunPSK" FontSize="20" Height="22" HorizontalAlignment="Left" Margin="107,2,0,0" Name="SpeedRadio3" VerticalAlignment="Top" IsChecked="{Binding Path=MySpeed3, Mode=TwoWay}" IsTabStop="False" />
                                <RadioButton Content="ด่วนที่สุด" FontFamily="TH SarabunPSK" FontSize="20" Height="22" HorizontalAlignment="Left" Margin="179,2,0,0" Name="SpeedRadio4" VerticalAlignment="Top" IsChecked="{Binding Path=MySpeed4, Mode=TwoWay}" IsTabStop="False" />
                            </Grid>
                        </GroupBox>
                    </StackPanel>
                    <StackPanel Margin="0,10,0,0" Name="stackPanel6" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="350,0,0,0" Text="วันที่  " Name="Date1TextBlock" />
                        <DatePicker Height="28" Name="CreateSendDatePicker" Width="115" FontFamily="Tahoma" FontSize="14" SelectedDate="{Binding Path=MyCreateSend.CreateSendDate, Mode=TwoWay}" />
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Text="{Binding Path=MyCreateSend.CreateSendDate, Mode=TwoWay, Converter={StaticResource dateConverter}}" Name="DateTextBlock" />
                    </StackPanel>
                        <StackPanel Margin="0,10,0,0" Name="stackPanel7" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="เรื่อง  " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="606" Text="{Binding Path=MyCreateSend.Title, Mode=TwoWay}" Name="TitleTextBox" TabIndex="4"  />
                    </StackPanel>
                        <StackPanel Margin="0,10,0,0" Name="stackPanel8" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="เรียน  " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="605" Text="{Binding Path=MyCreateSend.ToPosition, Mode=TwoWay}" Name="ToPositionTextBox" TabIndex="5"  />
                        </StackPanel>
                        <StackPanel Margin="0,10,0,0" Name="stackPanel9" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="อ้างถึง  " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="597" Text="{Binding Path=MyCreateSend.Reference, Mode=TwoWay}" Name="ReferenceTextBox" TabIndex="6"  />
                        </StackPanel>
                        <StackPanel Margin="0,10,0,0" Name="stackPanel10" Orientation="Horizontal">
                            <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="สิ่งที่ส่งมาด้วย  " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20"   VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="224" Text="{Binding Path=MyTextAttached, Mode=TwoWay}" Name="NameAttachTextBox" TabIndex="7"  />
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20"  Text="ไฟล์แนบ  " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20"   VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="158" Text="{Binding Path=MyTextFilePath, Mode=TwoWay}" Name="PathTextBox" TabIndex="8"  />
                        <Button Content="เลือกไฟล์" FontSize="20" Height="30" Name="BrowseButton" Width="63" FontFamily="TH SarabunPSK" Click="BrowseButton_Click" TabIndex="9" />
                        <Button Content="เพิ่ม" FontSize="20" Height="30" Name="AddButton" Width="63" FontFamily="TH SarabunPSK" Click="AddButton_Click" TabIndex="10" />
                        <!--<ListBox BorderThickness="0" DisplayMemberPath="NameAttached" FontFamily="TH SarabunPSK" FontSize="20" ItemsSource="{Binding Path=MyCreateSendICV, Mode=TwoWay}" />-->
                        </StackPanel>
                    <StackPanel Margin="0,10,0,0" Name="stackPanel110" Orientation="Horizontal">
                        <DataGrid AutoGenerateColumns="False"  Name="ItemFileDataGrid" Width="641" Margin="120,0,0,0" ItemsSource="{Binding Path=CreateAttachedSendICV}" SelectedItem="{Binding Path=SelectedAttached, Mode=TwoWay}" ContextMenu="{Binding Source={StaticResource MyContextMenu}}" FontFamily="TH SarabunPSK" FontSize="20">
                            <DataGrid.Columns>
                             
                                <DataGridTextColumn Binding="{Binding Path=NameAttached, Mode=TwoWay}" Header="สิ่งที่สิ่งมาด้วย" Width="300" />
                                <DataGridTextColumn Binding="{Binding Path=FileAttached, Mode=TwoWay}" Header="ไฟล์แนบ" />
                             
                            </DataGrid.Columns>
                        </DataGrid>
                    
                    </StackPanel>
                    <StackPanel Name="stackPanel111" Orientation="Horizontal" Margin="0,10,0,0">
                        <TextBlock Text="สิ่งที่ส่งมาด้วย  " FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" />
                        <ListBox ItemsSource="{Binding Path=CreateAttachedSendICV, Mode=TwoWay}"  FontFamily="TH SarabunPSK" FontSize="20" BorderThickness="0" >
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <TextBlock Text="{Binding Path=NameAttached}" />
                                        <!--<TextBlock Text="{Binding Path=FileAttached}" />--> 
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </StackPanel>
                    <StackPanel Margin="0,10,0,0" Name="stackPanel11" Orientation="Horizontal">
                        <TextBox Margin="120,0,0,0" FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="True" BorderThickness="0" Width="641" Text="{Binding Path=MyCreateSend.Paragraph1, Mode=TwoWay}" Name="Paragraph1TextBox" TabIndex="11" />
                    </StackPanel>
                        <!--<StackPanel Margin="0,10,0,0" Name="stackPanel12" Orientation="Vertical">
                            <TextBox AcceptsReturn="True" AcceptsTab="True" BorderThickness="0" FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,40,0" Text="{Binding Path=Paragraph2, Mode=TwoWay}" TextWrapping="Wrap" VerticalAlignment="Stretch" />
                        </StackPanel>-->
                        <!--<StackPanel Margin="0,10,0,0" Name="stackPanel13" Orientation="Vertical">
                            <TextBox AcceptsReturn="True" AcceptsTab="True" BorderThickness="0" FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,40,0" Text="{Binding Path=Paragraph3, Mode=TwoWay}" TextWrapping="Wrap" VerticalAlignment="Stretch" />
                        </StackPanel>-->
                        <StackPanel Margin="0,20,0,0" Name="stackPanel14" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="250,0,0,0" Text="คำลงท้าย  " Width="65" Name="PostScriptTextBlock" />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="387" TextAlignment="Center" Text="{Binding Path=MyCreateSend.PostScript, Mode=TwoWay}" Name="PostScriptTextBox" TabIndex="12"  />
                        </StackPanel>
                        <StackPanel Margin="0,60,0,0" Name="stackPanel15" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="250,0,0,0" Text="ผู้ลงนาม  " Width="65" Name="EndorserTextBlock" />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="388" TextAlignment="Center" Text="{Binding Path=MyCreateSend.Endorser, Mode=TwoWay}" Name="EndorserTextBox" TabIndex="13"  />
                        </StackPanel>
                        <StackPanel Name="stackPanel16" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="250,0,0,0" Text="ตำแหน่งงาน  " Width="65" Name="PositionTextBlock" />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="388" TextAlignment="Center" Text="{Binding Path=MyCreateSend.Position, Mode=TwoWay}" Name="PositionTextBox" TabIndex="14"  />
                        </StackPanel>
                        <StackPanel Name="stackPanel17" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="250,0,0,0" Text="สังกัด  " Width="65" Name="BelongToTextBlock" />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="388" TextAlignment="Center" Text="{Binding Path=MyCreateSend.BelongTo, Mode=TwoWay}" Name="BelongToTextBox" TabIndex="15"  />
                        </StackPanel>
                        <StackPanel Margin="0,40,0,0" Name="stackPanel18" Orientation="Horizontal">
                        <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="หน่วยงานเจ้าของเรื่อง  " Name="OwnerTextBlock" />
                        <ComboBox DisplayMemberPath="ThaiName" Height="27" Name="FromDivisionComboBox" Width="179" Margin="10,0,0,0" ItemsSource="{Binding Path=EntityModels.Divisions}" SelectedValue="{Binding Path=MyCreateSend.FromDivisionID}" SelectedValuePath="DivisionID" FontFamily="TH SarabunPSK" FontSize="20" TabIndex="16" />
                        <TextBlock Name="FromDivisionTextBlock" FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" />
                    </StackPanel>
                        <StackPanel Name="stackPanel19" Orientation="Horizontal">
                            <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="โทร. " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="388" TextAlignment="Left" Text="{Binding Path=MyCreateSend.Tell, Mode=TwoWay}" Name="TellTextBox" TabIndex="17" />
                    </StackPanel>
                        <StackPanel Name="stackPanel20" Orientation="Horizontal">
                            <TextBlock FontFamily="TH SarabunPSK" FontSize="20" Margin="120,0,0,0" Text="โทรสาร. " />
                        <TextBox  FontFamily="TH SarabunPSK" FontSize="20" TextWrapping="Wrap"  VerticalAlignment="Stretch" AcceptsReturn="True" AcceptsTab="False" BorderThickness="0" Width="388" TextAlignment="Left" Text="{Binding Path=MyCreateSend.Fax, Mode=TwoWay}" Name="FaxTextBox" TabIndex="18"  />
                    </StackPanel>
                    </StackPanel>
               
            </Grid>
            
            </ScrollViewer>
       
          
        <StackPanel Height="34" HorizontalAlignment="Left" Name="stackPanel2" VerticalAlignment="Top" Width="792" Orientation="Horizontal" >
            <Button Content="บันทึก" Height="29" Name="SaveButton" Width="75" Margin="250,0,0,0" FontFamily="TH SarabunPSK" FontSize="20" Click="SaveButton_Click" TabIndex="19" />
            <Button Content="พิมพ์" FontFamily="TH SarabunPSK" FontSize="20" Height="29" Name="PrintButton" TabIndex="20" Width="64" Margin="20,0,0,0" Click="PrintButton_Click" />
            <Button Content="ตัวอย่างก่อนพิมพ์" Height="29" Name="PrintPreviewButton" Width="102" Margin="20,0,0,0" FontFamily="TH SarabunPSK" FontSize="20" Click="PrintPreviewButton_Click" TabIndex="20" />
            <Button Content="ยกเลิก" Height="29" Name="CancelButton" Width="75" Margin="20,0,0,0" FontFamily="TH SarabunPSK" FontSize="20" Click="CancelButton_Click" TabIndex="21" />
        </StackPanel>
    </Grid>

</Window>
